<div class="layui-tab-content">
<!--    <form onsubmit="return false" class="layui-fluid" id="search_form">-->
<!--        <div class="layui-card">-->
<!--            <div class="layui-card-body">-->
<!--                <table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>-->
<!--            </div>-->
<!--        </div>-->
<!--    </form>-->

    <form onsubmit="return false" class="layui-fluid" id="search_form">
        <div class="layui-card">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <select name="belong_type" class="layui-select">
                            <option value="">客户类型</option>
                            {foreach $alias['belong_type_alias'] as $k => $v}
                                {if $k <3 }
                                    <option value="{$k}">{$v}</option>
                                {/if}
                            {/foreach}
                        </select>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn layuiadmin-btn-list layui-btn-primary" lay-submit lay-filter="LAY-app-contlist-search">
                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> 搜索
                        </button>
                    </div>
                </div>
            </div>



            <div class="layui-card-body">
                <table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
            </div>
        </div>
    </form>


</div>
<script>
    layui.use(['table','laydate','form'],function () {
        var $ = layui.$
            ,table = layui.table
            ,laydate = layui.laydate
            ,form = layui.form;


        laydate.render({
            elem: '#pay_range', //指定元素
            type: 'month',
            range: '~',
            trigger:'click'
        });

        //监听搜索
        form.on('submit(LAY-app-contlist-search)', function(data){
            var field = data.field;
            //执行重载
            table.reload('LAY-app-content-list', {
                where: field
                ,page:1
            });
        });


        table.render({
            elem: '#LAY-app-content-list'
            ,url: "{:url('statistic/etprs')}"
            ,totalRow: true //开启合计行
            ,cols: [[
                 {field: 'industry_alias',  title: '行业',totalRowText: '合计：'}
                 ,{field: 'dairuzhu',  title: '待入驻', totalRow: true}
                 ,{field: 'yiruzhu',  title: '已入驻', totalRow: true}
                 ,{field: 'tuichu',  title: '已退出', totalRow: true}
                 ,{field: 'total',  title: '合计', totalRow: true}
            ]]
        });
    });

</script>
